#include "DoorLock.hpp"
#include "ImageRecorder.hpp"

using namespace std;

/*
 * main method. the program needs to be started with "sudo ./FRDoorLock mode=ImageRecorder/DoorLock".
 * depending on the command line parameters the program will either start in image recorder or door lock mode.
 * the image recorder mode will allow the user to take images (with preview) and create a training set.
 * the door lock mode will allow users to authenticate agains the eigenface training set.
 */
int main(int argc, const char *argv[]) {
	if (argc < 2) {
		cout << "Usage: sudo ./FRDoorLock mode=ImageRecorder/DoorLock" << endl;
		return -1;
	}

	const string mode(argv[1]);

	if (mode == "mode=ImageRecorder") {
		ImageRecorder();
	} else if (mode == "mode=DoorLock") {
		DoorLock();
	} else {
		cout
				<< "ERROR: Unknown program mode. Usage: sudo ./FRDoorLock mode=ImageRecorder/DoorLock"
				<< endl;
	}

	return 0;
}
